home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000217-20000824
/
000041_news@columbia.edu _Wed Feb 23 14:10:31 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2000-08-23
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA10375
for <kermit.misc@watsun.cc.columbia.edu>; Wed, 23 Feb 2000 14:10:30 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id OAA24811
for kermit.misc@watsun.cc.columbia.edu; Wed, 23 Feb 2000 14:03:02 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: jrd@cc.usu.edu (Joe Doupnik)
Subject: Re: Array name passed to macro as argument?
Message-ID: <Jf10IGSklAzn@cc.usu.edu>
Date: 23 Feb 00 11:52:16 MDT
Organization: Utah State University
To: kermit.misc@columbia.edu
In article <891805$ltt$1@newsmaster.cc.columbia.edu>, fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
> In article <8915uc$4e2$1@nnrp1.deja.com>,
> Peter Easthope <peter_easthope@gulfnet.pinc.com> wrote:
> : In <88u9fb$ev5$1@newsmaster.cc.columbia.edu>
> : posted at 22 Feb 2000 15:20:11 GMT Frank da Cruz said,
> : fdc> ... in C-Kermit 7.0 / K95 1.1.19, you can write this more
> : simply ... declare \&d[] = Sea urchin.
> :
> : Thanks Frank. It is in my memory banks for future
> : use. The current application is meant to run on MS-DOS
> : Kermit also; for now I will retain the more primitive
> : notation to declare the array.
> :
> : fdc> Here's a version of your Test macro that works:
> :
> : def test {
> : local \%x
> : .\%x := \\&\%1[1]
> : echo {\%x}
> : .\%x := \\&\%1[2]
> : echo {\%x}
> : }
> :
> : MS-DOS Kermit complains: "?More parameters are needed".
> :
> : What does the "." in ".\%x" mean? What
> : documentation is recommended for these details?
> :
> That's a new "programmer friendly" assignment notation, but
> it only works in K95 and C-Kermit.
>
> OK, here's another way that works in MS-DOS Kermit 3.15, as
> well as in K95 and C-Kermit:
>
> def arraytest { ; Define macro
> local \%x
> assign \%x \\\%1[1]
> echo {\%x}
> assign \%x \\\%1[2]
> echo {\%x}
> }
> declare \&a[10] ; Set up array
> assign \&a[1] one
> assign \&a[2] two
> assign \&a[3] three
>
> arraytest &a ; Call macro with array name.
>
> Note that TEST is a built-in command in MS-DOS Kermit. Backslash
> craziness is avoided by passing the array name to the macro sans
> backslash. The statement:
>
> assign \%x \\\%1[1]
>
> constructs the string \&a[1] and assigns it to \%x.
>
> - Frank
-------
Just a comment from the trenches on this item. The fancier notation
used by Frank is nifty. However when it comes to implementing it in assembler
within a small space for a DOS program and inside of especially complex
code for parsing, then things are sticky. Thus I decided to not implement
the dot semicolon-equal etc material as there are equivalent ways of
accomplishing the goal. Appologies for the inconvience of having two ways
of doing this.
Joe D.